<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>已选课程</title>
    <style type="text/css">
        .list {
            margin-top: 30px;
            border-collapse: collapse;
            border: 1px solid #ccc;
            width: 400px;
        }

        .list td {
            border: 1px solid #ccc;
            text-align: center;
            height: 30px;
        }
    </style>
    <script>
        function del(id) {
            console.log('del it is ' + id + ' item');
            location.href = '<%=request.getContextPath()%>/studentSubject/deleteSchedule?id=' + id;
        }
        function toPage(pageIndex) {
            $("#pageIndex").val(pageIndex);
            $("#scheduleForm").submit();
        }
    </script>
</head>
<body>
<%@include file="../common/headStudent.jsp"%>
<form id="scheduleForm" action="/scvs/studentSubject/information" method="post">
    <input type="hidden" id="pageIndex" name="pageIndex" value="${pageIndex}"/>
    <input type="hidden" onclick="submit"/>
</form>
<table align="center" class="list">
    <tr style="font-weight: bold">
        <td width="">id</td>
        <td style="width: 100px;">学生姓名</td>
        <td style="width: 100px;">课程名称</td>
        <td style="width: 100px;">课时</td>
        <td style="width: 100px;">操作</td>
    </tr>
    <c:forEach items="${studentSubjects}" var="item">
        <tr>
            <td>${item.id}</td>
            <td>${item.student.realName}</td>
            <td>${item.subject.name}</td>
            <td>${item.subject.period}</td>
            <td><a href="javascript:del(${item.id})">退选</a></td>
        </tr>
    </c:forEach>
</table>
<%@include file="../common/footer.jsp"%>
</body>
</html>
